package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 图片识别记录表
 * @TableName image_recognition
 */
@TableName(value ="image_recognition")
@Data
public class ImageRecognition implements Serializable {
    /**
     * 识别ID
     */
    @TableId(type = IdType.AUTO)
    private Long recognitionId;

    /**
     * 设备ID
     */
    private Long deviceId;

    /**
     * 图片URL
     */
    private String imageUrl;

    /**
     * 图片类型：1-水质图片，2-污染物图片
     */
    private Integer imageType;

    /**
     * 识别结果
     */
    private String recognitionResult;

    /**
     * 水质等级
     */
    private Integer waterQualityLevel;

    /**
     * 污染物类型
     */
    private String pollutantTypes;

    /**
     * 置信度分数
     */
    private BigDecimal confidenceScore;

    /**
     * 识别时间
     */
    private Date recognitionTime;

    /**
     * 状态：1-识别中，2-识别完成
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ImageRecognition other = (ImageRecognition) that;
        return (this.getRecognitionId() == null ? other.getRecognitionId() == null : this.getRecognitionId().equals(other.getRecognitionId()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getImageUrl() == null ? other.getImageUrl() == null : this.getImageUrl().equals(other.getImageUrl()))
            && (this.getImageType() == null ? other.getImageType() == null : this.getImageType().equals(other.getImageType()))
            && (this.getRecognitionResult() == null ? other.getRecognitionResult() == null : this.getRecognitionResult().equals(other.getRecognitionResult()))
            && (this.getWaterQualityLevel() == null ? other.getWaterQualityLevel() == null : this.getWaterQualityLevel().equals(other.getWaterQualityLevel()))
            && (this.getPollutantTypes() == null ? other.getPollutantTypes() == null : this.getPollutantTypes().equals(other.getPollutantTypes()))
            && (this.getConfidenceScore() == null ? other.getConfidenceScore() == null : this.getConfidenceScore().equals(other.getConfidenceScore()))
            && (this.getRecognitionTime() == null ? other.getRecognitionTime() == null : this.getRecognitionTime().equals(other.getRecognitionTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecognitionId() == null) ? 0 : getRecognitionId().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getImageUrl() == null) ? 0 : getImageUrl().hashCode());
        result = prime * result + ((getImageType() == null) ? 0 : getImageType().hashCode());
        result = prime * result + ((getRecognitionResult() == null) ? 0 : getRecognitionResult().hashCode());
        result = prime * result + ((getWaterQualityLevel() == null) ? 0 : getWaterQualityLevel().hashCode());
        result = prime * result + ((getPollutantTypes() == null) ? 0 : getPollutantTypes().hashCode());
        result = prime * result + ((getConfidenceScore() == null) ? 0 : getConfidenceScore().hashCode());
        result = prime * result + ((getRecognitionTime() == null) ? 0 : getRecognitionTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recognitionId=").append(recognitionId);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", imageUrl=").append(imageUrl);
        sb.append(", imageType=").append(imageType);
        sb.append(", recognitionResult=").append(recognitionResult);
        sb.append(", waterQualityLevel=").append(waterQualityLevel);
        sb.append(", pollutantTypes=").append(pollutantTypes);
        sb.append(", confidenceScore=").append(confidenceScore);
        sb.append(", recognitionTime=").append(recognitionTime);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}